package o;

import android.content.Context;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.IdRes;
import com.bumptech.glide.Glide;
import huawei.widget.HwButton;

public abstract class bhl extends fai implements OnClickListener {
    protected Context ˎ;
    private View ˏ;

    public abstract int ʻ();

    public abstract boolean ʽ();

    public abstract String ˊ();

    public abstract String ˎ();

    public abstract String ॱ();

    public bhl(Context context) {
        this.ˎ = context;
        ˎ(d.ˏ);
    }

    public View ˊ(@IdRes int i) {
        if (this.ˏ == null) {
            return null;
        }
        return this.ˏ.findViewById(i);
    }

    public View ˏ() {
        if (this.ˎ == null) {
            if (Logger.ˎ()) {
                Logger.ˏ("BuoyGuideBaseWindow", "onCreateView, context == null");
            }
            return null;
        }
        this.ˏ = ॱˋ();
        return this.ˏ;
    }

    public void ˋ() {
        ॱॱ();
    }

    private void ॱॱ() {
        if (this.ˎ != null) {
            if (this.ˏ != null) {
                bgg.ˏ(this.ˎ, this.ˏ);
            }
            this.ˏ = ॱˋ();
            ˎ(this.ˏ);
            bgg.ॱ(this.ˎ, this.ˏ, ͺ());
        } else if (Logger.ˎ()) {
            Logger.ˏ("BuoyGuideBaseWindow", "refreshView, context == null");
        }
    }

    private View ॱˋ() {
        if (this.ˎ != null) {
            return this.ˎ.getResources().getConfiguration().orientation == 1 ? ॱˎ() : ॱᐝ();
        } else {
            if (Logger.ˎ()) {
                Logger.ˏ("BuoyGuideBaseWindow", "updateView, context == null");
            }
            return null;
        }
    }

    private View ॱˎ() {
        View inflate = View.inflate(this.ˎ, beo$j.ॱॱ, null);
        ॱ(inflate);
        HwButton hwButton = (HwButton) inflate.findViewById(beo$e.ʻᐝ);
        hwButton.setMinimumWidth(this.ˎ.getResources().getDisplayMetrics().widthPixels / 2);
        hwButton.setOnClickListener(this);
        ((LinearLayout) inflate.findViewById(beo$e.ㆍ)).setOnClickListener(this);
        return inflate;
    }

    private View ॱᐝ() {
        View inflate = View.inflate(this.ˎ, beo$j.ॱॱ, null);
        ॱ(inflate);
        return inflate;
    }

    private void ॱ(View view) {
        ((TextView) view.findViewById(beo$e.ꓸ)).setText(ॱ());
        ((TextView) view.findViewById(beo$e.ᐧ)).setText(ˎ());
        TextView textView = (TextView) view.findViewById(beo$e.ᐝˋ);
        if (ʽ()) {
            textView.setText(ˊ());
            textView.setVisibility(0);
        } else {
            textView.setVisibility(8);
        }
        Glide.ˏ(view).ॱ(Integer.valueOf(ʻ())).ˏ((ImageView) view.findViewById(beo$e.ᐝˊ));
        HwButton hwButton = (HwButton) view.findViewById(beo$e.ʻᐝ);
        hwButton.setMinimumWidth(this.ˎ.getResources().getDisplayMetrics().widthPixels / 2);
        hwButton.setOnClickListener(this);
        ((LinearLayout) view.findViewById(beo$e.ㆍ)).setOnClickListener(this);
    }

    public void onClick(View view) {
        int id = view.getId();
        if (id == beo$e.ʻᐝ || id == beo$e.ㆍ) {
            fam.ॱ().ˋ(this.ˎ, this);
        }
    }
}
